package dao.impl;

import dao.BaseDao;
import dao.UserDao;
import pojo.User;

import java.util.List;

public class UserDaoImpl extends BaseDao implements UserDao {

    @Override
    public int addUser(User user) {
        String sql="insert into user values(?,?,?,?)";
        return baseUpdate(sql,user.getUno(),user.getU_name(),user.getU_pwd(),user.getU_pho());
    }

    @Override
    public List<User> findAll() {
        String sql="select * from user";
        return baseQuery(User.class,sql);
    }
}
